package com.qqtech.qquan.mall.dao;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.qqtech.core.frame.dao.BaseDao;
import com.qqtech.qquan.mall.model.MallShop;
import com.qqtech.qquan.mall.model.MallShopQuery;
import com.qqtech.qquan.mall.model.MallShopVo;

public interface MallShopDao extends BaseDao<MallShop> {
	
	/**
	 * 后台查询
	 * @param query
	 * @param pageable
	 * @return
	 */
	public Page<MallShopVo> queryPageListAdmin(MallShop query, Pageable pageable);
	
	/**
	 * 更新店铺销售订单量字段，数量加1
	 * @param shopId
	 * @return
	 */
	public int addSaleOrderCount(Integer shopId);
	
	/**
	 * 更新店铺销售订单量字段，数量减1
	 * @param shopId
	 * @return
	 */
	public int subSaleOrderCount(Integer shopId);
	
	/**
	 * 我收藏的全部店铺
	 * @param userId 用户id
	 * @param communityId 社区id
	 * @param type 店铺类型:1-直营超市,2-圈商店铺
	 * @param style 店铺种类:1-邻里店,2-社区店铺
	 * @param auditStatus 店铺审核状态，auditStatus=null则查全部状态
	 * @return
	 */
	public List<MallShopVo> queryListByCollect(Integer userId, Integer communityId, Integer type, Integer style, Integer auditStatus);

	public List<MallShopVo> queryAllShop();

	public Page<MallShopVo> queryDistancePage(MallShopQuery query, Pageable pageable);

	public List<MallShopVo> queryListByCollectV1(Integer userId, Integer communityId, Integer type, Integer style,
			Integer auditStatus, BigDecimal x, BigDecimal y);
}
